{% extends 'frame/base.html' %} {% load staticfiles %} {% block title_block %} 配置列表 {% endblock %} {% block mystyle_css %}
<style type="text/css">
	.todo-list>li p {
		width: 100%;
		padding: 15px 0 10px 35px;
	}
</style>
{% endblock %} {% block body_block %}
<div class="modal fade" style="z-index: 10000;" id="edit_modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
				<h4 class="modal-title">配置编辑</h4>
			</div>
			<div class="modal-body col-md-12" >
				<hr style="FILTER: alpha(opacity=100,finishopacity=0,style=3);margin-top: 0px;" width="100%" color=#987cb9 SIZE=3>
                    <div class="custom-tabs-line tabs-line-bottom left-aligned">
                        <ul class="nav" role="tablist" >
                            <li class="active"><a href="#tab-bottom-left1" role="tab" data-toggle="tab">配置信息</a></li>
                            <li ><a href="#tab-bottom-left2" role="tab" data-toggle="tab">变量/参数/hooks</a></li>
                            <li ><a href="#tab-bottom-left3" role="tab" data-toggle="tab">request</a></li>
                            <li ><a href="#tab-bottom-left4" role="tab" data-toggle="tab">extract/validate</a></li>
                        </ul>
                    </div>
                     <br>
                    <div class="tab-content">
                        <div class="tab-pane fade in active" id="tab-bottom-left1" style="padding-left: 8px;">             
                            <br>
                            <form class="form-horizontal" id="case_create">
                                <div class="form-group  has-feedback">
                                    <label class="control-label col-md-2 text-primary" for="config_name">配置名称：</label>
                                     <div class="col-md-5">
                                        <input type="text" class="form-control" id="config_name" aria-describedby="inputSuccess3Status" name="config_name" placeholder="请输入配置名称" value="">
                                        <span class="glyphicon glyphicon-th-large form-control-feedback" aria-hidden="true"></span>
                                    </div>
                                </div>

                                 <div class="form-group  has-feedback">
                                    <label class="control-label col-md-2 text-primary" for="project_name">所属项目：</label>
                                    <div class="col-md-5">
                                    <select name="project_name" class="form-control" id="project_name">
                                        <option value="-1">请选择</option>
                                    </select>
                                    </div>
                                </div>

                                <div class="form-group  has-feedback">
                                    <label class="control-label col-md-2 text-primary" for="module_name">所属模块：</label>
                                    <div class="col-md-5">
                                    <select name="module_name" class="form-control" id="module_name">
                                        <option value="-1">请选择</option>
                                    </select>
                                    </div>
                                </div>

                                <div class="form-group  has-feedback">
                                    <label class="control-label col-md-2 text-primary" for="creator">编写人员：</label>
                                     <div class="col-md-5">
                                        <input type="text" class="form-control" id="creator" aria-describedby="inputSuccess3Status" name="creator" placeholder="请输入编写人员名称" value="">
                                        <span class="glyphicon glyphicon-th-large form-control-feedback" aria-hidden="true"></span>
                                    </div>
                                </div>
                            </form>
                        </div>

                            <div class="tab-pane fade" id="tab-bottom-left2" style="padding-left: 8px;">
                                        <br>
                                <button class="btn btn-info" value="添 加" onclick="add_row('variables')">+ variables</button>
                                <button class="btn btn-danger" value="删 除" onclick="del_row('variables')">- variables</button>
                                <button class="btn btn-info" value="添 加" onclick="add_params('params')">+ param</button>
                                <button class="btn btn-danger" value="删 除" onclick="del_row('params')">- param</button>
                                <button class="btn btn-info" value="添 加" onclick="add_row('hooks')">+ hooks</button>
                                <button class="btn btn-danger" value="删 除" onclick="del_row('hooks')">- hooks</button>

                                <form id="form_variables">
                                    <table class="table table-hover table-condensed table-bordered table-striped" id="variables">
                                        <caption>变量:</caption>
                                        <thead>
                                        <tr class="active text-success">
                                            <th width="5%" align="center">操作</th>
                                            <th width="30%" align="center">Key</th>
                                            <th width="10%" align="center">Type</th>
                                            <th width="55%" align="center">Value</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </form>

                                <form id="form_params">
                                    <table class="table table-hover table-condensed table-bordered table-striped" id="params">
                                        <caption>参数:</caption>
                                        <thead>
                                        <tr class="active text-success">
                                            <th width="5%" align="center">操作</th>
                                            <th width="20%" align="center">Key</th>
                                            <th width="75%" align="center">Value</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </form>

                                <form id="form_hooks">
                                    <table class="table table-hover table-condensed table-bordered table-striped" id="hooks">
                                        <caption>hooks:</caption>
                                        <thead>
                                        <tr class="active text-success">
                                            <th width="5%" align="center">操作</th>
                                            <th width="47.5%" align="center">setup_hooks</th>
                                            <th width="47.5%" align="center">teardown_hooks</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </form>
                            </div>

                            <div class="tab-pane fade" id="tab-bottom-left3" style="padding-left: 8px;">
                                <br>   
                                 <div class="form-inline">
                                    <div class="form-group">
                                        <div class="input-group" >
                                            <div class="input-group-addon">URL</div>
                                            <input type="text" class="form-control" id="url" name="url" placeholder="api url">
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <div class="input-group">
                                            <div class="input-group-addon">Method</div>
                                            <select class="form-control" name="method" id="method">
                                                <option>POST</option>
                                                <option>GET</option>
                                                <option>PUT</option>
                                                <option>DELETE</option>
                                            </select>
                                        </div>
                                    </div>

                                    <div class="form-group ">
                                        <div class="input-group">
                                            <div class="input-group-addon">Type</div>
                                            <select class="form-control" name="DataType" id="DataType">
                                                <option>data</option>
                                                <option>json</option>
                                                <option>params</option>
                                            </select>
                                        </div>
                                    </div>

                                    <button class="btn btn-info" value="添 加" id="add_data" onclick="add_row('data')">+ data
                                    </button>
                                    <button class="btn btn-danger" value="删 除" id="del_data" onclick="del_row('data')">- data
                                    </button>
                                    <button class="btn btn-info" value="添 加" onclick="add_row('header')">+ headers</button>
                                    <button class="btn btn-danger" value="删 除" onclick="del_row('header')">- headers</button>

                                    <form id="form_request_data">
                                        <table class="table table-hover table-condensed table-bordered table-striped" id="data">
                                            <caption>data:</caption>
                                            <thead>
                                            <tr class="active text-success">
                                                <th width="5%" align="center">操作</th>
                                                <th width="30%" align="center">Key</th>
                                                <th width="5%" align="center">Type</th>
                                                <th width="60%" align="center">Value</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </form>

                                    <form id="form_request_header">
                                        <table class="table table-hover table-condensed table-bordered table-striped" id="header">
                                            <caption>headers:</caption>
                                            <thead>
                                            <tr class="active text-success">
                                                <th width="5%" align="center">操作</th>
                                                <th width="40%" align="center">Key</th>
                                                <th width="55%" align="center">Value</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                        </table>
                                    </form>
                                </div>
                            </div>

                            <div class="tab-pane fade" id="tab-bottom-left4" style="padding-left: 8px;">
                                <br>   
                                <button class="btn btn-info" value="添 加" onclick="add_row('extract')">+ extract
                                </button>
                                <button class="btn btn-danger" value="删 除" onclick="del_row('extract')">- extract
                                </button>
                                <button class="btn btn-info" value="添 加" onclick="add_row('validate')">+ validate</button>
                                <button class="btn btn-danger" value="删 除" onclick="del_row('validate')">- validate</button>
                                <form id="form_extract">
                                    <table class="table table-hover table-condensed table-bordered table-striped" id="extract">
                                        <caption>extract:</caption>
                                        <thead>
                                        <tr class="active text-success">
                                            <th width="5%" align="center">操作</th>
                                            <th width="30%" align="center">Key</th>
                                            <th width="55%" align="center">Value</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </form>
                                <form id="form_validate">
                                    <table class="table table-hover table-condensed table-bordered table-striped" id="validate">
                                        <caption>validate:</caption>
                                        <thead>
                                        <tr class="active text-success">
                                            <th width="5%" align="center">操作</th>
                                            <th width="32%" align="center">Check</th>
                                            <th width="10%" align="center">Comparator</th>
                                            <th width="8%" align="center">Type</th>
                                            <th width="45%" align="center">Expected</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </form>
                    </div>
			</div>
			<input id="edit_config_id" style="display: none;"/>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
				<button type="button" class="btn btn-primary" id="submit_modify">提交更改</button>
			</div>
		</div>
	</div>
</div>
<div class="main">
	<!-- MAIN CONTENT -->
	<div class="main-content">
		<div class="container-fluid">
			<div class="row">
				<div class="col-md-12">
					<div class="panel">
						<div class="panel-heading">
							<span class="ion-md-flag" id="title">配置列表</span>
							<a class="ion-md-add btn btn-sm font-white" id="add_config"> 新增配置</a>
							<a class="ion-md-add btn btn-sm font-white" id="add_configs"> 批量导入</a>
						</div>
						<hr style="FILTER: alpha(opacity=100,finishopacity=0,style=3);margin-top: 0px;" width="100%" color=#987cb9 SIZE=3>
						<div id="search-bar" class="row">
							<div class="col-sm-2 col-md-1 col-lg-1 input">
								<input type="text" class="form-control" id="search_name" placeholder="配置名称">
							</div>
							<div class="col-sm-2 col-md-1 col-lg-1 input">
								<input type="text" class="form-control" id="search_project" placeholder="所属项目">
							</div>
							<div class="col-sm-2 col-md-1 col-lg-1 input">
								<input type="text" class="form-control" id="search_module" placeholder="所属模块">
							</div>
							<div class="col-sm-2 col-md-1 col-lg-1 input">
								<input type="text" class="form-control" id="search_creator" placeholder="编写人员">
							</div>
							<a href="#" class="btn btn-sm btn-success search" id="search_btn">搜索</a>
						</div>
						<div class="table-responsive" id="config_list_table">
							<table class="table table-hover">
								<thead>
									<tr class="success">
										<th>
											<input type="checkbox" id="slect_all" />
										</th>
										<th>序号</th>
										<th>配置名称</th>
										<th>所属项目</th>
										<th>所属模块</th>
										<th>编写人员</th>
										<th>创建时间</th>
									</tr>
								</thead>
								<tbody id="config_list_body">
								</tbody>
							</table>
						</div>
						<nav aria-label="Page navigation" id="page_navigation_wrapper">
							<ul class="pagination">
								<li id="pre_page_wrapper">
									<a aria-label="Previous" id="pre_page" href="#">
										<span aria-hidden="true">&laquo;</span>
									</a>
								</li>
								<li>
									<a id="page1" style="cursor: pointer;">1</a>
								</li>
								<li>
									<a id="page2" style="cursor: pointer;">2</a>
								</li>
								<li>
									<a id="page3" style="cursor: pointer;">3</a>
								</li>
								<li>
									<a id="page4" style="cursor: pointer;">4</a>
								</li>
								<li>
									<a id="page5" style="cursor: pointer;">5</a>
								</li>
								<li style="display: none;">
									<a id="page_curr">1</a>
								</li>
								<li id="next_page_wrapper">
									<a aria-label="Next" id="next_page" href="#">
										<span aria-hidden="true">&raquo;</span>
									</a>
								</li>
							</ul>
						</nav>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script src="{% static '/frame/js/pageIndicator.js' %}"></script>
<script src="{% static '/frame/js/router.js' %}"></script>
<script src="{% static '/api/js/netutils.js' %}"></script>
<script src="{% static '/api/js/config_list.js' %}"></script>
<!-- END MAIN CONTENT -->
{% endblock %}